class Skeleton
{
	public:
		//Name of the skeleton/bone,  fbx has them all tagged as skeletons 
		FbxString m_name;
		//The unique id
		int m_id;
		//Name of parent, kind of not needed since it has the unique id but hey it's there incase of!
		FbxString m_parentName;
		//The unique id of parent
		int m_parentID;
		//The local trs!
		double* m_localTranslation;
		double* m_localRotation;
		double* m_localScale;
		//The length of the skeleton/bone
		//double m_length;
		//Dual quaternion values for the pose
		double* m_bindpose;

		void Init(FbxNode* a_node)
		{
			m_localTranslation = new double[3];
			m_localRotation = new double[3];
			m_localScale = new double[3];

			if (g_usingDualQuaternions)
			{
				m_bindpose = new double[8];
			}
			else
			{
				m_bindpose = new double[16];
			}

			m_parentName = "";
			m_name = "";
			m_parentID = -1;

			FbxSkeleton* f_skeleton =  (FbxSkeleton*) a_node->GetNodeAttribute();	
			
			for (int i = 0; i < 3; i++)
			{
				m_localTranslation[i] = a_node->LclTranslation.Get()[i];
				m_localRotation[i] = a_node->LclRotation.Get()[i];
				m_localScale[i] = a_node->LclScaling.Get()[i];
			}
			
			//Look after parent name
			FbxNode* f_parent = a_node->GetParent();

			if (f_parent != NULL && f_parent != g_root)
			{
				m_parentName = f_parent->GetName();
				m_parentID = GetNodeID(f_parent);
			}			
			
			m_name += a_node->GetName();
			m_id = GetNodeID(a_node);	

			int f_poseCount = g_scene->GetPoseCount();		

			bool f_poseFound = false;

			for (int i = 0; i < f_poseCount; i++)
			{
				FbxPose* f_pose = g_scene->GetPose(i);	
				
				int f_poseNodeIndex = f_pose->Find(a_node);
				//I'd use != -1, but the examples use > -1, so maybe there's some special cases where nodeIndex is -2 or something
				if (f_poseNodeIndex > -1)
				{
					f_poseFound = true;
					FbxAMatrix f_poseMatrix = GetPoseMatrix(f_pose, f_poseNodeIndex);

					if (g_usingDualQuaternions)
					{
						SetDualQuaternion(f_poseMatrix, m_bindpose);
					}
					else
					{
						SetMatrix(f_poseMatrix, m_bindpose);
					}				

					break;
				}
			}

			if (!f_poseFound)
			{
				FbxAMatrix f_poseMatrix;

				if (g_usingDualQuaternions)
				{
					SetDualQuaternion(f_poseMatrix, m_bindpose);
				}
				else
				{
					SetMatrix(f_poseMatrix, m_bindpose);
				}
			}
		}
};